<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        #box{width: 100px;height:100px;background: #ccc}
        .msg{width: 200px;height:200px;background: #efefef;display: none}
    </style>
</head>
<body>
    <div id="box">鼠标放上来</div>
    <div class="msg">
        要提示的信息
    </div>
</body>
<script>
    var obox = document.getElementById("box");
    var omsg = document.querySelector(".msg");

    // 鼠标进入事件
    obox.onmouseover = function(){
        // 显示提示框
        omsg.style.display = "block";
    }
    // 鼠标离开事件
    obox.onmouseout = function(){
        // 延时器隐藏提示框
        setTimeout(function(){
            omsg.style.display = "none";
        },300)
    }

</script>
</html>